import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TGuildPartyConfig } from "../../../Message/Db/Tables/TGuildPartyConfig";
type int = number;
//class GuildPartyConfig
    
    export  class GuildPartyConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._partyConfigArray = [];
            if (GuildPartyConfig._instance != null) 
            {
                throw new Error(" GuildPartyConfig 单例 ");
            }
            GuildPartyConfig._instance = this;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_guild_party_config.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TGuildPartyConfig();
                loc1.id = loc2.id;
                loc1.type = loc2.type;
                loc1.costContribution = loc2.costContribution;
                loc1.costGold = loc2.costGold;
                loc1.factor = loc2.factor;
                loc1.bosses = loc2.bosses;
                this._map[loc1.type] = loc1;
                this._partyConfigArray.push(loc1);
            }
            return;
        }

        public getPartyConfig(arg1: int): TGuildPartyConfig
        {
            return this._map[arg1];
        }

        public GuildPartyConfig.get partyConfigArray(): Array<any>
        {
            return this._partyConfigArray;
        }

        public static get instance(): GuildPartyConfig
        {
            if (GuildPartyConfig._instance == null) 
            {
                GuildPartyConfig._instance = new GuildPartyConfig();
            }
            return GuildPartyConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_partyConfigArray: Array<any>;

        /* internal */ static /* var */_instance: GuildPartyConfig;
    }
